package com.dididoctor.doctor.Activity.Main.Message;

import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;

import com.dididoctor.doctor.MV.EduActivity;
import com.dididoctor.doctor.R;

/**
 * Created by boy on 2016/4/21.
 */
public class MessageDetailActivity extends EduActivity{
    private TextView mTvTitle;
    private ImageView mBtnBack;

    private WebView mWvService;
    private String webUrl;
    @Override
    public void setContentLayout() {
        setContentView(R.layout.activity_message_detail);
        webUrl = getIntent().getStringExtra("webUrl");

    }

    @Override
    public void init() {
        /**头部**/
        initTitleView();

        mWvService = (WebView) findViewById(R.id.webview);
        if (!"".equals(webUrl) && webUrl != null) {
            mWvService.loadUrl(webUrl);
            //覆盖WebView默认使用第三方或系统默认浏览器打开网页的行为，使网页用WebView打开
            mWvService.setWebViewClient(new WebViewClient() {
                @Override
                public boolean shouldOverrideUrlLoading(WebView view, String url) {
                    // TODO Auto-generated method stub
                    //返回值是true的时候控制去WebView打开，为false调用系统浏览器或第三方浏览器
                    view.loadUrl(url);
                    return true;
                }
            });
        }
    }

    private void initTitleView() {
        mTvTitle = (TextView) findViewById(R.id.tv_title);
        mTvTitle.setText("消息详情");
        mBtnBack = (ImageView) findViewById(R.id.btn_back);
    }

    @Override
    public void onClickEvent(View view) {

    }


}
